﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControl_nap_gold : System.Web.UI.UserControl
{
    //protected string strUserID;
    protected string strGold;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (clsUsers.CheckLoginUser_Client())
        {
            xgetInfoUsers();
        }
        else
        {
            Response.Redirect("/");
        }
    }

    private void xgetInfoUsers()
    {
        //strUserID = clsUsers.Users_GetValueCooKie(basConst.COOKIE_USER_ID);
        ltrUserID.Text = clsUsers.Users_GetValueCooKie(basConst.COOKIE_USER_ID);
        strGold = String.Format("{0:0,0 Gold}", clsUsers.USER_FND(1, 1, clsUsers.Users_GetValueCooKie(basConst.COOKIE_USER_ID), "", "", -1, -1).Tables[0].Rows[0]["us_gold"].ToString());
    }

    protected void btnNapGold_Click(object sender, EventArgs e)
    {
        var strOutMsg = "";
        clsGold.NapGold(ltrUserID.Text, txtSeriCrad.Text, txtMaSoCard.Text, ddltypeCrad.SelectedValue, out strOutMsg);
        OsPortal.oHtmlHelper.Alert(strOutMsg, this.Page);
        xgetInfoUsers();
    }
}